Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Replace Arc.Ecto.Schema with importable Arc.Ecto.Changeset. #5

Closed
wants to merge 1 commit into from

Conversation

mdlkxzmcp
Copy link
Owner

Quote from original PR:

This fixes the current dialyzer error, but also cleans up the API and removes the need for cast_attachments/4 to be a macro.

With this new API, one can access the current behaviour with:

defmodule TestUser do
  use Ecto.Schema

  import Ecto.Changeset
  import Arc.Ecto.Changeset

  schema "users" do
    field :first_name, :string
    field :avatar, DummyDefinition.Type
  end

  def changeset(struct, params) do
    struct
    |> cast(params, ~w(first_name)a)
    |> cast_attachments(params, ~w(avatar)a)
  end
end

This, in my mind, makes more sense as we are trying to access a changeset function.

With breaking changes, this would require a version bump.

If this PR is something of interest, I can also update the documentation.

Remove the need for cast_attachments/4 to be a macro.
mdlkxzmcp added a commit that referenced this pull request Feb 22, 2019
@mdlkxzmcp mdlkxzmcp closed this Feb 22, 2019
mdlkxzmcp added a commit that referenced this pull request Feb 25, 2019
Reflect on changes from last changes made with PR #5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants